<div class="layui-body">
	<div class="aright">
	<div class="arz cl">{if condition="$config.dump_txt eq 0"}<button id="danger" data-val="1" class="layui-btn layui-btn-lg">开启文字链导流</button>{else/}<button id="danger" data-val="0" class="layui-btn layui-btn-danger">关闭文字链导流</button>{/if}&nbsp;|&nbsp;<a href="{:url('man/lead/add_txt')}"><i class="layui-icon">&#xe608;</i>添加导量视频</a></div>
	<form method="post" class="aform cl" >
	<table width="100%">
	      <tr>

			<th width="5%" align="center">ID编号</th>
	        <th width="25%" align="center">标题</th>
	        <th width="6%" align="center">视频VID</th>
	        <th width="6%" align="center">分享时间</th>
			<th width="9%" align="center">最后修改时间</th>
	        <th width="9%" align="center">基本操作</th>
	      </tr>
	      {volist name="txt" id="vo"}
			<td align="center">{$vo.id}</td>
	        <td align="center">{$vo.name}</td>
			<td align="center">{$vo.vid}</td>
			<td align="center">{$vo.delay_time}</td>
			<td align="center">{$vo.ptime}</td>
	        <td align="center"><a href="{:url('man/lead/edit_txt',array('id'=>$vo['id']))}">修改</a> | <a onclick="deleted({$vo.id})">删除</a>
	        </td>
	      </tr>
	      {/volist}
	 </table>
	 </form>
	 		<div class="pages">
 				{$txt->render()}
	 	 	</div>
	</div>
	</div>
</div>
<script>
layui.use('layer',function(){
	var layer = layui.layer;
})
function deleted(aid){
	$.post("{:url('man/lead/delete')}",{'aid':aid},function(data){
		if(data){
			layer.msg("删除成功");
			setTimeout(function(){
				window.location.reload();
			},1000);
			
		}
	})
}

$(function(){
  $("#danger").click(function(){
     var nval=$(this).attr('data-val');
       $.post("{:url('man/lead/changeStatus')}",{'status':nval},function(data){
          layer.msg(data);
          setTimeout(function(){
				window.location.reload();
			},1000);
       })
     });
});
</script>